/**
 * @description Account 账号信息表
 * @author LI
 */

const seq = require('../sequelize')
const { STRING, INTEGER, DECIMAL } = require('../types')

// account account 写入到数据库时为 accounts
const Account = seq.define('account', {
  account: {
    type: STRING,
    allowNull: false,
    comment: '账号'
  },
  pwd: {
    type: STRING,
    allowNull: false,
    comment: '密码'
  },
  name: {
    type: STRING,
    comment: '名称/姓名/2链接用户的店铺名称'
  },
  position: {
    type: STRING,
    comment: '职位'
  },
  companyName: {
    type: STRING,
    comment: '单位名称'
  },
  companyAddress: {
    type: STRING,
    comment: '单位地址/2链接用户的店铺地址，多个用逗号隔开'
  },
  typecode: {
    type: INTEGER,
    allowNull: false,
    comment: '账号类型/0管理员/1普通用户/2链接用户,供应商/3业主/4监理/5工长/6施工员'
  },
  adPrice: {
    type: DECIMAL,
    defaultValue: 0,
    comment: '用户的广告价格，一次需要扣除多少钱'
  },
  balance: {
    type: DECIMAL,
    defaultValue: 0,
    comment: '余额/2链接用户'
  },
  typeLevel: {
    type: STRING,
    comment: '二级账号类型/7瓦工/8木工/9水电工/10油漆工'
  },
  remark: {
    type: STRING,
    comment: '要求，备注'
  },
  reserve: {
    type: STRING,
    comment: '保留字段'
  }
},
{
  comment: '账号信息表',
})

module.exports = Account
